package com.d6game.web.dao;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.d6game.web.entity.User;
import com.d6game.web.orm.hibernate.BaseDao;
@Repository("userDao")
public class UserDao extends BaseDao<User, Long> {

	public User findUser(String username) {
		Criterion c1 = Restrictions.eq("username", username);
		return this.findUnique(c1);
	}
	public User findUserByEmail(String email) {
		Criterion c1 = Restrictions.eq("email", email);
		return this.findUnique(c1);
	}
	public User findUserByOuterid(String outerid) {
		Criterion c1 = Restrictions.eq("outerid", outerid);
		return this.findUnique(c1);
	}
}
